package chapter92;

import java.util.Scanner;

public class CalculateNum1 {

    int baseNum;//基础数字

    int item;// 当前项

    int count; //数字的加次

    int result; //总的结果

    public void showResult(int bn,int cou){

        item=bn;
        result=bn;
        String info=""+bn;
        for (int i=1;i<cou;i++){
            item=item*10+bn;
            info=info+"+"+item;
            result+=item;
        }
        info=info+"="+result;
        System.out.println(info);
    }

    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        System.out.println("请输入数值");
        int num=input.nextInt();
        System.out.println("请输入次数");
        int count=input.nextInt();
        CalculateNum1 ca=new CalculateNum1();
        ca.showResult(num,count);


    }

}
